import asyncio
import time
# 创建一个用于测试的协程任务的函数
async def test_task(a, b):
    result = a + b
    await asyncio.sleep(result)
    print("执行耗时任务：{}秒！".format(result))

async def main(loop):
    # 创建读个协程任务的列表
    tasks = [loop.create_task(test_task(0, i))for i in range(1, 4)]
    await asyncio.wait(tasks)
start_time = time.time()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(main(loop))
end_time = time.time()
print("程序实际执行时间为：",end_time - start_time,"秒！")